#ifndef _ini_H_
#define _ini_H_
#include <stdint.h>
#include "dictionary.h"

#ifdef __cplusplus
extern "C" {
#endif

void ini_set_error_callback(int (*errback)(const char *, ...));
void ini_freedict(dictionary *d);
int  ini_getnsec(const dictionary *d);
void ini_dump_ini(const dictionary *d, FILE *f);

dictionary *ini_load(const char *ininame);
dictionary *ini_load_file(FILE *in, const char *ininame);

const char *ini_getsecname(const dictionary *d, int n);

void ini_dumpsection_ini(const dictionary *d, const char *s, FILE *f);

int ini_getsecnkeys(const dictionary *d, const char *s);

const char **ini_getseckeys(const dictionary *d, const char *s, const char **keys);

const char *ini_getstring(const dictionary *d, const char *key, const char *def);

int ini_getint(const dictionary *d, const char *key, int notfound);

long int ini_getlongint(const dictionary *d, const char *key, long int notfound);

int64_t ini_getint64(const dictionary *d, const char *key, int64_t notfound);

uint64_t ini_getuint64(const dictionary *d, const char *key, uint64_t notfound);

double ini_double(const dictionary *d, const char *key, double notfound);

int ini_getboolean(const dictionary *d, const char *key, int notfound);

int ini_set(dictionary *ini, const char *entry, const char *val);

void ini_unset(dictionary *ini, const char *entry);

int ini_find_entry(const dictionary *ini, const char *entry);
#ifdef __cplusplus
}
#endif
#endif
